import numpy as np
import matplotlib.pyplot as plt

X = np.arange(-50, 51, 2)
Y = X ** 2 # **代表幂

# plt.plot(X, Y, color='blue', label='Y=X^2')
plt.plot(X, Y, color='blue')

# plt.xlabel('X')
# plt.ylabel('Y')
# plt.title('Plot of Y = X^2')
# plt.grid(True)
# 取消勾选 Show plots in toolwindow 选项
plt.legend()
plt.show()
